{extends 'admin/layout/table-main.tpl'}

{block title}菜单管理{/block}
{block smallTitle}系统内的菜单管理。{/block}
{block head}
	<link href="{asset('admin/css/plugins/chosen/chosen.css')}" rel="stylesheet">
{/block}
{block main}
<div class="ibox float-e-margins">
	<div class="ibox-content">
		<div class="row row-lg">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<h4 class="example-title">{block title}{/block}</h4>
						<div class="btn-group hidden-xs" id="exampleTableEventsToolbar" role="group">
						</div>
						<form method="post" action="{route('AdminMenuLoadSave')}">
							<button type="submit" class="btn blue"><i class="icon-ok"></i> 保存</button>
							<table class="table table-striped table-hover">
								<thead>
								<tr>
									<th>#</th>
									<th>别名</th>
									<th>路由名称</th>
									<th>父级菜单</th>
								</tr>
								</thead>
								<tbody>
								{foreach $data as $key=> $item}
									<tr >
										<td><input type="checkbox" class="checkboxes" value="{$key}" name="enable['{$key}']">  </td>
										<td>{$key}</td>
										<td>{$item}</td>
										<td>
											<input type="hidden" name="name['{$key}']" value="{$item}">
											<select class="chosen-select" name="pid['{$key}']" >
												<option value="0">选择上级菜单</option> {foreach $parent as $list}
													<option value={$list.id} {if $data.pid=== $list.id}selected="selected"{/if}>{$list.option}</option> {/foreach}
											</select>
											<input type="text" name="sort['{$key}']" value="0">
											<select class="input-medium" name="status['{$key}']" >
												<option value="Yes">有效</option>
												<option value="No">无效</option>
											</select>
										</td>
									</tr>
								{/foreach}
								</tbody>
							</table>
							<button type="submit" class="btn blue"><i class="icon-ok"></i> 保存</button>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}

{block script}
	<script src="{asset('admin/js/plugins/chosen/chosen.jquery.js')}"></script>
	<script src="{asset('admin/js/demo/form-advanced-demo.min.js')}"></script>
{/block}
